const connection = require('../db/index')

const userInfo = (data) => {
    return new Promise((resolve, reject) => {
        console.log(data);
        const { username } = data;
        resolve({
            code: 200,
            msg: "操作成功",
            data: {
                roles: [username ? username : "admin"],
                permissions: [
                    "system:user:add",
                    "system:user:edit",
                    "system:user:remove",
                ],
                user: {
                    userName: username ? username : "admin",
                    nickName: "野克",
                },
            },
        })
    })
}


const userList = (data) => {
    return new Promise((resolve, reject) => {
        resolve({
            code: 200,
            msg: "操作成功",
            data: [
                {
                    id: "0",
                    phone: "13100000000",
                    name: "Tom",
                    status: "0",
                },
                {
                    id: "1",
                    phone: "13100000001",
                    name: "Tom",
                    status: "0",
                },
                {
                    id: "2",
                    phone: "13100000002",
                    name: "Tom",
                    status: "0",
                },
                {
                    id: "3",
                    phone: "13100000003",
                    name: "Tom",
                    status: "0",
                },
            ],
        })
    })
}


module.exports = {
    userInfo,
    userList
}